﻿Imports Oracle.DataAccess.Client
Imports System.Data.OleDb
Partial Class _Default
    Inherits System.Web.UI.Page
    Private db As Object, rs As Object
    Private x As Integer
    Private Cmd As OracleCommand
    Private Dset As Data.DataSet
    Private Dadap As OleDbDataAdapter
    Private dt As Data.DataTable
    Private Cnx As OracleConnection
    Private oradb As String = "Data Source=XE;User Id=SIRA;Password=SIRA123;"
    Private Sql As String
    Private dr As OracleDataReader

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Cnx = New OracleConnection(oradb)
        LlenarComisarias()
        LlenarUsuariosCategorias()
    End Sub
    Protected Sub LlenarComisarias()
        Sql = "select DOMICILIO from COMISARIAS"
        Try
            Cnx.Open()
            Cmd = New OracleCommand(Sql, Cnx)
            Cmd.Connection = Cnx
            Cmd.CommandText = Sql
            ' cmd.CommandType = CommandType.Text
            dr = Cmd.ExecuteReader()
            While dr.Read()
                DDLComisarias.Items.Add(dr.Item("DOMICILIO"))
            End While
        Catch ex As Exception
            MsgBox(ex.Message.ToString())
        Finally
        End Try
        Cnx.Close()
    End Sub
    Protected Sub LlenarUsuariosCategorias()
        Sql = "select CATEGORIA from USUARIOSCATEGORIAS"
        Try
            Cnx.Open()
            Cmd = New OracleCommand(Sql, Cnx)
            Cmd.Connection = Cnx
            Cmd.CommandText = Sql
            ' cmd.CommandType = CommandType.Text
            dr = Cmd.ExecuteReader()
            While dr.Read()
                DDLUsuariosCategorias.Items.Add(dr.Item("CATEGORIA"))
            End While
        Catch ex As Exception
            MsgBox(ex.Message.ToString())
        Finally
        End Try
        Cnx.Close()
    End Sub

End Class
